# -*- mode: snippet -*-
# name: staked bar plot - matplotlib
# key: matplotlib.bar.stacked
# contributor: Shuguang Sun
# --
# -*- coding: utf-8 -*-
fig, ax = plt.subplots()
$0
ax.bar(labels, men_means, width, yerr=men_std, label='Men')
# stack
ax.bar(labels, women_means, width, yerr=women_std, bottom=men_means,
       label='Women')

ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.legend()

plt.show()